<template>
  <!-- 产品授权 -->
  <div style="height:520px">
    <FormPanel
      ref="infoProduct"
      :list="initForm"
      :cols="2"
      :labelWidth="110"
      :isSubmitBtn="false"
      :formType="value.type"
      class="mtop"
    />
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
export default {
  mixins: [dictionary],
  props: {
    value: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      initForm: this.initFormFun()
    };
  },
  mounted() {
    console.log(this.value); //获取到行id
    //请求接口进行赋值，自己写吧
  },
  methods: {
    //搜索数据
    initFormFun() {
      return [
        {
          type: 'MULTIPLE_CHECKBOX',
          label: '经销商形式',
          fieldName: 'CHECKBOX1',
          initialValue: [],
          itemList: [{ text: '传统油车', value: '1' }, { text: '新能源', value: '2' }], //复选框数据源
          rules: [
            {
              required: true,
              message: '必填',
              trigger: 'change'
            }
          ]
        },
        {
          type: 'MULTIPLE_CHECKBOX',
          label: '车系',
          fieldName: 'CHECKBOX2',
          initialValue: [],
          itemList: [{ text: 'EX', value: '1' }, { text: 'EU', value: '2' }], //复选框数据源
          rules: [
            {
              required: true,
              message: '必填',
              trigger: 'change'
            }
          ]
        },
        {
          type: 'MULTIPLE_CHECKBOX',
          label: '车型',
          fieldName: 'CHECKBOX3',
          initialValue: [],
          itemList: [{ text: 'EX1', value: '1' }, { text: 'EX2', value: '2' }], //复选框数据源
          rules: [
            {
              required: true,
              message: '必填',
              trigger: 'change'
            }
          ]
        }
      ];
    }
  }
};
</script>